﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CrystalDecisions.CrystalReports.Engine;

namespace Sireass.Asp.Cartas
{
    public partial class CartaTerminacion : System.Web.UI.Page
    {
        private long _id;
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (string.IsNullOrWhiteSpace(Request.QueryString["id"]))
                    return;

                _id = Convert.ToInt64(Request.QueryString["id"]);
                UIVisorCarta.ReportSource = GenerarCartaAceptacion(_id);
            }
        }

        private ReportDocument GenerarCartaAceptacion(long id)
        {
            Dictionary<string, string> datos = null;

            ReportDocument carta = new ReportDocument();
            carta.Load(Server.MapPath(@"ReporteCartaTerminacion.rpt"));
            //foreach (string llave in datos.Keys)
            //    reporteAcuse.SetParameterValue(llave, datos[llave]);

            return carta;
        }
    }
}